package com.quanyue.haircut;

import com.quanyue.auto.cache.EnableCache;
import com.quanyue.auto.fs.spring.EnableFs;
import com.quanyue.auto.sharding.conf.EnableSharSource;
import com.quanyue.auto.sharding.service.TableRuleService;
import com.quanyue.auto.sharding.service.impl.InitTableRuleService;
import com.quanyue.auto.wechat.AutoConfigWechat;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.scheduling.annotation.EnableScheduling;

@EnableFs
@EnableCache
@EnableSharSource
@EnableScheduling
@AutoConfigWechat
@SpringBootApplication(exclude = DataSourceAutoConfiguration.class)
@ComponentScan(basePackages = {"com.quanyue"})
public class BootApplication {

    public static void main(String[] args) {
        SpringApplication.run(BootApplication.class);
    }

    @EnableAutoConfiguration
    public static class Configuration {
    }

    @Bean
    public TableRuleService initTableRuleService() {
        return new InitTableRuleService();
    }
}
